package com.example.hms.controller;

import com.example.hms.entity.Customer;
import com.example.hms.entity.RoomType;
import com.example.hms.service.CustomerService;
import com.example.hms.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

@RestController
@RequestMapping("customer")
public class CustomerController {
    //    动态注入下一层RoomService（服务层）
    @Resource
    private CustomerService customerService;

    @RequestMapping(value = "/selectAllCustomer",method = RequestMethod.GET)
    public Result selectAllCustomer(String customerName, String phoneNumber,String identificationCard) {
        return customerService.selectAllCustomer(customerName,phoneNumber,identificationCard);
    }

    @RequestMapping(value = "/insert",method = RequestMethod.GET )
    public Result insert(Customer customer, HttpServletRequest request)
        {return customerService.insert(customer, request);}

    @RequestMapping(value = "/update",method = RequestMethod.GET)
    public Result update(Customer customer, HttpServletRequest request)
        {return customerService.update(customer, request);}

    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    public Result delete(Customer customer, HttpServletRequest request)
        {return customerService.delete(customer, request);}

}
